<?php
declare(strict_types=1);
namespace SixShop\Core\Contracts;

use JsonSerializable;

/**
 * 物流信息响应
 */
class LogisticsInformationResponse implements JsonSerializable
{
    /**
     * @param string $extensionID 物流模块扩展ID
     * @param string $number 物流单号
     * @param string $type 物流类型
     * @param array $raw 原始数据
     */
    public function __construct(
        public string $extensionID,
        public string $number,
        public string $type,
        public array $raw)
    {
    }

    public function jsonSerialize(): mixed
    {
        return [
            'extension_id' => $this->extensionID,
            'number' => $this->number,
            'type' => $this->type,
            'raw' => $this->raw
        ];
    }
}